import config from "@/config";
import http from "@/utils/request";

export default {
	getAllClient: {
		url: `${config.API_URL}/adminapi/basic/shop_client/all`,
		name: "获取所有客户",
		get: async function () {
			return await http.get(this.url);
		},
	},
	getAllApply: {
		url: `${config.API_URL}/adminapi/basic/shop_apply/all`,
		name: "获取所有供应商",
		get: async function () {
			return await http.get(this.url);
		},
	},
	getConfig: {
		url: `${config.API_URL}/adminapi/config/getConfig`,
		name: "获取配置信息",
		get: async function () {
			return await http.get(this.url);
		},
	},
	upload: {
		url: `${config.API_URL}/adminapi/upload/image`,
		name: "文件上传",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	uploadFile: {
		url: `${config.API_URL}/adminapi/upload/files`,
		name: "附件上传",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	exportFile: {
		url: `${config.API_URL}/fileExport`,
		name: "导出附件",
		get: async function (data, config = {}) {
			return await http.get(this.url, data, config);
		},
	},
	importFile: {
		url: `${config.API_URL}/fileImport`,
		name: "导入附件",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	file: {
		menu: {
			url: `${config.API_URL}/file/menu`,
			name: "获取文件分类",
			get: async function () {
				return await http.get(this.url);
			},
		},
		list: {
			url: `${config.API_URL}/file/list`,
			name: "获取文件列表",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
	},
	getDictData: {
		url: `${config.API_URL}/adminapi/config/dict`,
		name: "获取配置信息",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	getAllList: {
		url: `${config.API_URL}/adminapi/config/getAllList`,
		name: "获取常用列表信息",
		get: async function (params) {
			return await http.get(this.url, params);
		},
	},
	setTableConfig: {
		url: `${config.API_URL}/adminapi/config/setTableConfig`,
		name: "设置表格配置",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	resetTableConfig: {
		url: `${config.API_URL}/adminapi/config/resetTableConfig`,
		name: "重置表格配置",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	getTableConfig: {
		url: `${config.API_URL}/adminapi/config/getTableConfig`,
		name: "获取表格配置",
		get: async function (data, config = {}) {
			return await http.get(this.url, data, config);
		},
	},
	getIndexData: {
		url: `${config.API_URL}/adminapi/workbench/index`,
		name: "获取首页数据",
		get: async function (data, config = {}) {
			return await http.get(this.url, data, config);
		},
	},
	allMenu: {
		url: `${config.API_URL}/adminapi/auth.menu/allMenu`,
		name: "获取首页数据",
		get: async function (data, config = {}) {
			return await http.get(this.url, data, config);
		},
	},
	setMenu: {
		url: `${config.API_URL}/adminapi/workbench/setMenu`,
		name: "设置首页菜单",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	getMenu: {
		url: `${config.API_URL}/adminapi/workbench/getMenu`,
		name: "获取首页菜单",
		get: async function (data, config = {}) {
			return await http.get(this.url, data, config);
		},
	},
	sendSmsCode: {
		url: `${config.API_URL}/adminapi/login/sendSmsCode`,
		name: "发送注册验证码",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},
	shopRegister: {
		url: `${config.API_URL}/adminapi/login/register`,
		name: "商户注册",
		post: async function (data, config = {}) {
			return await http.post(this.url, data, config);
		},
	},


    // 商品拼音简码
	getPinyin: {
        url: `${config.API_URL}/adminapi/shop.company/get_pinyin`,
        name: "获取拼音简码",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
};
